package com.spark3

import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.sql.SparkSession

object MainTest01 {

  def main(args: Array[String]): Unit = {

    val conf = new SparkConf().setMaster("local[2]").setAppName("xxx")
    val sc = new SparkContext(conf)

//    val spark = SparkSession
//      .builder()
//      .appName("MainTest01")
//      .master("local[2]")
//      .config("hive.metastore.uris","thrift://localhost:9083")
//      .config("spark.sql.warehouse.dir", "hdfs://localhost:8020/user/hive/warehouse")
//      .enableHiveSupport()
//      .getOrCreate()
//
//    // create table twh(id int,name string)
//    // spark.sql("use sp3").show(false)
//    spark.sql("load data local inpath '/Users/tanweihua/Desktop/123.txt' overwrite into table sp3.twh").show(false)
//
//    spark.stop()

  }
}
